package com.mall.common.domain.content;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import com.mall.common.domain.BaseEntity;

/**
 * 广告位置
 */
@Entity
@Table(name = "s_adver_position")
public class AdvertPositionDomain extends BaseEntity {

	private static final long serialVersionUID = -4290225897733933815L;
	private String title;//标题
	private String position;//广告位置
	private String type;//广告类型：图片或者flash
	private int width;//宽度
	private int height;//高度
	private Set<AdvertDomain> advert;//广告位置对应的广告

	@Column(nullable = false)
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(nullable = false)
	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	@Column(nullable = false)
	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy="advertPosition")
	@Cascade(value = { CascadeType.DELETE })
	public Set<AdvertDomain> getAdvert() {
		return advert;
	}

	public void setAdvert(Set<AdvertDomain> advert) {
		this.advert = advert;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

}
